<link rel="stylesheet" type="text/css" href="../addons/jy_merch/css/style.css?v=2019-03">
<style>
    .fui-list-group{
        margin-top: 0;
        display: none;
    }
.sortmenu_cate li .imgWrap {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    text-align: center;
    float: left;
    margin-top: 0;
    margin-right: 0.2rem;
}
</style>
<div class="fui-page page-merch-list">
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click="access_json('/index/')"></a>
        </div>
        <div class="title">商户列表</div>
        <div class="fui-header-right"></div>
    </div>
    <div class="fui-content" style="bottom: 2.4rem">
		<div class="fui-searchbar bar">
                <div class="searchbar center">
                    <input type="submit" ng-click="pagedata.getlist(pagedata.params.keyword)" class="searchbar-cancel searchbtn" value="搜索" />
                    <div class="search-input">
                        <i class="icon icon-search"></i>
                        <input type="search" placeholder="输入关键字..." class="search" ng-model="pagedata.params.keyword">
                    </div>
                </div>
        </div>
        <ul class="sortMenu fui-list">
            <li ng-click="pagedata.paramstype=1;" class="fui-list-inner" id="sortmenu_rule" data-class="sortmenu_rule"><span  id="sortmenu_rule_text">附近</span><i class="icon jinyunicon icon-moreunfold"></i></li>
            <li  ng-click="pagedata.paramstype=2;" class="fui-list-inner" id="sortmenu_cate" data-class="sortmenu_cate"><span id="sortmenu_cate_text">分类</span><i class="icon jinyunicon icon-moreunfold"></i></li>
            <li  ng-click="pagedata.paramstype=3;" class="fui-list-inner" id="sortmenu_sort" data-class="sortmenu_sort"><span id="sortmenu_sort_text">智能排序</span><i class="icon jinyunicon icon-moreunfold"></i></li>
            <div ng-if="pagedata.paramstype==1" class="sortmenu_rule">
                <ul ng-click="pagedata.paramstype=0">
                    <li range="500" ng-click="pagedata.params.orderby='juli';tool.get_list('jy_merch/merchuser/list/',true)" text="附近">附近</li>
                    <li range="0.5"  ng-click="pagedata.params.orderby='500';tool.get_list('jy_merch/merchuser/list/',true)" text="500米">500米</li>
                    <li range="1"  ng-click="pagedata.params.orderby='1000';tool.get_list('jy_merch/merchuser/list/',true)" text="1000米">1000米</li>
                    <li range="2"  ng-click="pagedata.params.orderby='2000';tool.get_list('jy_merch/merchuser/list/',true)" text="2000米">2000米</li>
                    <li range="5" ng-click="pagedata.params.orderby='5000';tool.get_list('jy_merch/merchuser/list/',true)" text="5000米">5000米</li>
                    <li range="10000" ng-click="pagedata.params.orderby='more';tool.get_list('jy_merch/merchuser/list/',true)" text="5000米以上">5000米以上</li>
                </ul>
            </div>
            <div class="sortmenu_cate" ng-if="pagedata.paramstype==2">
                <ul ng-click="pagedata.paramstype=0" style="padding:0.5rem 0">
                    <li cateid="0" ng-click="pagedata.params.cateid=0;tool.get_list('jy_merch/merchuser/list/',true)" text="全部分类" class="on"><i class="fa fa-th-large"></i>&nbsp;全部分类</li>
                    <li ng-repeat="item in pagedata.cate" ng-click="pagedata.params.cateid=item.id;tool.get_list('jy_merch/merchuser/list/',true)" cateid="{{item.id}}" text="{{item.catename}}">
                        <span class="imgWrap" style="">
                        <img src="{{tomedia(item.image)}}" class="thumb_url">
                        </span>
                        &nbsp;{{item.catename}}
                    </li>
                </ul>
            </div>
            <div class="sortmenu_sort" ng-if="pagedata.paramstype==3">
                <ul ng-click="pagedata.paramstype=0">
                    <li sorttype="0"  ng-click="pagedata.params.orderby='juli';tool.get_list('jy_merch/merchuser/list/',true)" text="距离最近">距离最近</li>
                    <li sorttype="1" ng-click="pagedata.params.orderby='time';tool.get_list('jy_merch/merchuser/list/',true)" text="最新入驻">最新入驻</li>
                 </ul>
            </div>
        </ul>
        <div class="fui-mask-m sort-mask" style="display: none;"></div>
        <div class="fui-cell-group qa-title">
            <div class="fui-cell">
                <div class="fui-cell-text">推荐商家</div>
            </div>
			<div ng-repeat="value in pagedata.list" class="fui-list store-item">
					<div class="fui-list-media">
						<div class="fui-list-media">
							<a ng-click="access_json('jy_merch/merch//id='+value.id)">
								<img src="{{tomedia(value.logo) || '../core/resource/images/nopic.jpg'}}" class="round">
							</a>
						 </div>
					</div>
					<div class="fui-list-inner">
						<div ng-click="access_json('jy_merch/merch//id='+value.id)">
							<div class="title"> <span class='storename'>{{value.merchname}}</span></div>
							<div ng-if="value.address!=''" class="text">
								地址: <span class='realname' style="color:#666">{{value.address}}</span> <a ng-click="pagedata.openLocation(value)" class='external'><i class='icon icon-map' style='color:#f90'></i></a>
							</div>
							<div  ng-if="value.mobile!=''" class="text">
								电话: <span class='address'>{{value.mobile}}</span> <a href="tel:{{value.mobile}}" class='external'><i class=' icon icon-phone' style='color:green'></i></a>
							</div>
							<div ng-if="value.catename!=''" class="text">
								分类: <span class='address'>{{value.catename}}</span>
							</div>
						  <div class="subtitle location">
								距离您:{{value.juli}}km
							</div>
						</div>
					</div>
				</div>
        </div>
        <div class='fui-content-inner'>
            <div ng-if="pagedata.list.length<1" class='content-empty'>
                <i class='icon icon-lights'></i><br/>暂时没有商家<br/><a ng-click="access_json('jy_weishop/index/')" class='btn btn-default-o external'>到处逛逛</a>
            </div>
            <div class='fui-list-group container'>
				 
			
			</div>
            <div ng-if="loading" class='infinite-loading'><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
        </div>
    </div>
        <div id="nearStore" style="display:none">
            <div class='fui-list store-item' id='nearStoreHtml'></div>
        </div>
    </script>
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=ZQiFErjQB7inrGpx27M1GR5w3TxZ64k7&s=1"></script>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
// 百度地图API功能
window.scope.location(function(re){
		scope.pagedata.params.lat_lng = re.lat_lng;
		scope.tool.get_list('jy_merch/merchuser/list/lat='+re.lat_lng.lat+'&lng='+re.lat_lng.lng,true);
});
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_merch/merchuser/list/');
}
scope.pagedata.openLocation=function(item){
	wx.openLocation({
	latitude: item.lat_lng.lat, // 纬度，浮点数，范围为90 ~ -90
	longitude: item.lat_lng.lng, // 经度，浮点数，范围为180 ~ -180。
		name: item.merchname, // 位置名
		address: item.address, // 地址详情说明
		scale: 20, // 地图缩放级别,整形值,范围从1~28。默认为最大
		infoUrl: '', // 在查看位置界面底部显示的超链接,可点击跳转
		success:function(){
			//alert(1111);
		}
	});
}
</script>
